<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Profile_model extends CI_Model
{
	
	public function __construct()
	{
		parent::__construct();

	}
	
	public function get_profile()
	{
	
		$query = $this->db->get('company_profile');
		return $query;
	}
	
	public function do_upload($id,$file_name)
	{
	$this->db->update('users',array('profile_image'=>$file_name),array('id'=>$id));	
	}
	
	public function find_profile(){
			$query = $this->db->get('company_profile');
			return $query->num_rows();
			
		}
		
		
	public function insert($data){

		$this->db->insert('company_profile',$data);
	}	
	
	
	public function edit_profile($id){
		$query = $this->db->get_where('company_profile', array('id' => $id));
		return $query;
	}
	
	
	public function update($edit_id, $data){
		$this->db->update('company_profile',$data,array('id'=>$edit_id));
	}
	
		


}
